﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Sayeet
{
    public partial class SettingsWindow : Form
    {
        public SettingsWindow()
        {
            InitializeComponent();
            portTextBox.Text = Sayeet.Properties.Settings.Default.Port.ToString();
            loginTextBox.Text = Sayeet.Properties.Settings.Default.Login;
            passTextBox.Text = Sayeet.Properties.Settings.Default.Password;
            serverTextBox.Text = Sayeet.Properties.Settings.Default.Server;
            
        }

        private void applyButton_Click(object sender, EventArgs e)
        {
            Sayeet.Properties.Settings.Default.Login = loginTextBox.Text;
            Sayeet.Properties.Settings.Default.Password = passTextBox.Text;
            Sayeet.Properties.Settings.Default.Server = serverTextBox.Text;
            Sayeet.Properties.Settings.Default.Port = Convert.ToInt32(portTextBox.Text);
            Sayeet.Properties.Settings.Default.Save();

            this.Close();
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }

    }
}
